package com.lancoo.answer.ui.answerSheet.vh;

import android.util.Log;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

import com.lancoo.answer.model.entity.AnswerSheetChildBean;
import com.lancoo.answer.model.eventBean.AnswerSheetEventBean;
import com.lancoo.answer.ui.answerSheet.AnswerSheetAdapter;

public class AnswerSheetBaseVH extends RecyclerView.ViewHolder {


    public AnswerSheetBaseVH(@NonNull View itemView) {
        super(itemView);
    }

    public void onClickAnswerSheet(AnswerSheetChildBean bean){
        AnswerSheetEventBean answerSheetEvent=new AnswerSheetEventBean();
        answerSheetEvent.setTypeIndex(bean.getTypeIndex());
        answerSheetEvent.setQuesIndex(bean.getQuesIndex());
        answerSheetEvent.setChildIndex(bean.getChildIndex());
        answerSheetEvent.setItemIndex(bean.getItemIndex());
        answerSheetEvent.setEventType(0);
//        EventBus.getDefault().post(answerSheetEvent);
        Log.e("eee","点击了");
        RecyclerView.Adapter<? extends RecyclerView.ViewHolder> bindingAdapter = getBindingAdapter();
        if(bindingAdapter instanceof AnswerSheetAdapter){
            ((AnswerSheetAdapter)bindingAdapter).onAnswerSheetItemClick(answerSheetEvent);
        }

    }
}
